package core;

import java.util.ArrayList;
import java.util.List;

import expression.bool.BoolExpr;
import expression.integer.IntVarExpr;

public class Predicate extends Common {
	private String name;
	private String comment;
	private BoolExpr constraint;
	private List<IntVarExpr> variables;

	public Predicate(Universe u, String n, String c, BoolExpr cst) {
		super(u);
		name = n;
		comment = c;
		constraint = cst;
		variables = new ArrayList<IntVarExpr>();
	}
	
	public String getName() {
		return name;
	}
	
	public String getComment() {
		return comment;
	}
	
	public BoolExpr getConstraint() {
		return constraint;
	}

	public String toString() {
		String s = "predicate " + name + " \t[" + comment + "] \t{ ";
		for (IntVarExpr v: getVariables()) {
			s += v.getName() + " ";
		}
		s += "} : " + constraint;
		return s;
	}
	
	public List<IntVarExpr> getVariables() {
		return variables;
	}
}
